int TOiw_User_CheckAdminIP(int iUserID,char* sIP)
{
	char sSource[4][4], sDB[4][4];
	char *pstDBip,sDBip[16];
	int ii,ij,iRetCode;

	TEnv_SetDB_System(&stDBLink,sErrMsg);
	sprintf(stDBLink.sQuery, "select Fip from t_sys_admin_bbs where fuser_id = %d", iUserID);
	stDBLink.iQueryType = 1;

	iRetCode = TLib_DB_ExecSQL(&stDBLink, sErrMsg);
	if (iRetCode != 0)
	{
	  TLib_Log_LogMsg( "%s ...fail",  stDBLink.sQuery);
		return -1;
	}
	
	iRetCode = TLib_DB_FetchRow(&stDBLink, sErrMsg);
	if (iRetCode != 0)
	{
	    TLib_DB_FreeResult(&stDBLink);
		return -1;
	}

	strcpy(sDBip,stDBLink.stRow[0]);
	pstDBip=sDBip;
	TLib_DB_FreeResult(&stDBLink);
	
	ii=0;ij=0;
	while (*sIP)
	{
	  if (*sIP!='.')
	  	{sSource[ii][ij++]=*sIP;}
	  else
		{sSource[ii][ij]=0;ii++;ij=0;}
	  sIP++;
	}
	sSource[ii][ij]=0;
	
	ii=0;ij=0;
	while (*pstDBip)
	{
	  if (*pstDBip!='.')
	  	{sDB[ii][ij++]=*pstDBip;}
	  else
		{sDB[ii][ij]=0;ii++;ij=0;}
	  pstDBip++;
	}	
	sDB[ii][ij]=0;
	
	for (ii=0;ii<4;ii++)
	{
	  if (strcmp(sSource[ii],sDB[ii])!=0 && strcmp(sDB[ii],"*")!=0) return 1;
	}
	
	return 0;
}
